<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import ReloadPrompt from './ReloadPrompt.vue'
import NavBar from '@/components/common/NavBar.vue'
import TabBar from '@/components/common/TabBar.vue'
</script>

<template>
  <router-view v-slot="{ Component }">
    <div
      w:w="screen"
      w:h="screen"
      w:flex="~ col nowrap"
      w:align="items-stretch"
      w:justify="between"
      w:overflow="hidden"
      w:pos="relative"
    >
      <div
        w:flex="none"
      >
        <NavBar :title="$route.meta.title" v-show="$route.meta.title" />
      </div>
      <div
        w:flex="1"
        w:overflow="y-scroll x-hidden"
        w:pos="relative"
      >
        <transition :name="$route.meta.transition||'backInRight'">
          <keep-alive :include="$store.getters['pages/getCachePages']">
            <component :is="Component" :key="$route.name" />
          </keep-alive>
        </transition>
      </div>
      <div
        w:flex="none"
      >
        <TabBar v-show="$route.meta.isTabBar" />
      </div>
    </div>
  </router-view>
  <ReloadPrompt />
</template>

<style>
@import 'assets/css/transition.css';
html,body{
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
.hide-scrollbar::-webkit-scrollbar{
  display: none;
}


</style>
